<!--阿里人脸样本页-->
<template>
    <div style="height: 100%;">

        <m-page-list
                :option="option"
                :page="page"
                :total="total"
                :table-data="tableData"
                :table-loading="tableLoading"
                v-model:value="query"
                @h-btn-click="hBtnClick"
                @col-btn-click="colBtnClick"
                @search-data="searchData"
        />

        <m-dialog-form ref="dialogRef" :data="dialogData" v-model:show="dialogShow" :option="dialogOption" @confirm="dialogConfirm" ></m-dialog-form>


    </div>

</template>

<script setup>

  import {ref,reactive,onMounted,nextTick} from 'vue'
  //组件
  import MPageList from '@/components/PageList'
  import MDialogForm from '@/components/DialogForm/DialogForm'
  //请求
  import {getAliyunFaceEntity,editDriverData,addDriverData,delDriverData} from '@/request/api/basicData'

  import {usePageList} from "../../composables/pageList";

  //引用类型字段参数
  import {refOpt} from "../const";

  let opts = {
    // auth_id: 'stop',
    getApi: getAliyunFaceEntity,
    addApi:addDriverData,
    editApi:editDriverData,
    delApi:delDriverData,
    idKey: 'driver_no',
  };
  let {option,page,total,tableLoading,tableData,query,dialogRef,dialogShow,dialogData,
    hBtnClick,colBtnClick,searchData,dialogOption,dialogConfirm} = usePageList(opts);


  option.hLBtns = [];

  //  查询条件参数配置
  option.conditions = [
    {...refOpt.user_name,rewriteInput: true,label: '用户编号',field_id:'user_id',col: 8},
    {label: '人脸样本id',type: 'text',field_id: 'entityid',col: 8},
    {label: '上传成功标识',type: 'picklist',field_id: 'is_upload_success',options: [
        {name: '成功',id: 'true'},
        {name: '失败',id: 'false'},
      ],col: 8},
    {label: '删除成功标识',type: 'picklist',field_id: 'is_delete_success',options: [
        {name: '成功',id: 'true'},
        {name: '失败',id: 'false'},
      ],col: 8},
    {label: '班车有效时间',type: 'datetimerange',field_id: ['effective_time_start','effective_time_end'],col: 16},
  ];


  // 表格列显示参数配置
  option.cols = [
    {prop: 'db_name', label: '数据库名',},
    {prop: 'entityid', label: '人脸样本id',},
    {prop: 'faceid', label: '人脸数据id',},
    {prop: 'remark', label: '备注',},
    {prop: 'effective_time_start', label: '班车有效时间起',},
    {prop: 'effective_time_end', label: '班车有效时间止',},
    {prop: 'pictures_link', label: '图片',type: 'picture',hidePic: true},
    {prop: 'is_upload_success', label: '上传成功标识',type: 'bool'},
    {prop: 'upload_err_msg', label: '上传错误信息',},
    {prop: 'upload_time_first', label: '首次上传时间',},
    {prop: 'upload_time_last', label: '最后上传时间',},
    {prop: 'is_delete_success', label: '删除成功标识',type: 'bool'},
    {prop: 'delete_err_msg', label: '删除错误信息',},
    {prop: 'delete_time_first', label: '首次删除时间',},
    {prop: 'delete_time_last', label: '最后删除时间',},
    {prop: 'modify_name', label: '修改员名',},
    {prop: 'modify_time', label: '修改时间',},
    {prop: 'input_name', label: '录入员名',},
    {prop: 'input_time', label: '录入时间',},
  ];
  option.colBtns = [];


  // 新增编辑弹窗录入项配置
  dialogOption.fieldList = [
    {...refOpt.user_name,editDisabled: true,label: '用户编号',field_id:'user_id',entityKey: 'user_id',valueKey: [{driver_no: 'user_id'},{driver_name: 'user_name'},'user_id'] ,col: 3},
    {field_id: 'driver_no',editDisabled: true, label: '司机工号',type: 'text',col: 3},
    {field_id: 'driver_name', label: '司机名称',type: 'text',col: 3},
  ];


</script>

